<?php
require_once ("../src/db/connectdatabase.php");

function getPurposeLoan() {
	$con = new ConnectDB();
	
	$tbl = "purposeloan";
	$fn = array('idpurpose', 'namepurp');
	$condetion = array('isuse' => true);
	return $con -> getvalueorderby($tbl, $fn, $condetion, 'datecreate');
}

echo json_encode(getPurposeLoan());
?>